#include "header.h"

int main()
{
    int clientfd = socket(AF_INET , SOCK_STREAM , 0);
    ERROR_CHECK(clientfd , -1 , "socket");

    struct sockaddr_in serveraddr;
    serveraddr.sin_family = AF_INET;
    serveraddr.sin_port = htons(9090);
    serveraddr.sin_addr.s_addr = inet_addr("127.0.0.1");

    int ret = connect(clientfd , (const struct sockaddr *)&serveraddr ,
                      sizeof(serveraddr));
    ERROR_CHECK(ret , -1 , "connect");

    printf("连接成功！ \n");

    sleep(5);

    const char * msg = "Hello , Server";
    ret = send(clientfd , msg , strlen(msg) , 0);
    printf("发送了 %d 字节数据 \n" , ret);



}
